package composite.pojo;

import java.util.ArrayList;
import java.util.List;

public class Employee {
    private String name;
    private String dept;
    private List<Employee> subList;

    public Employee(String name, String dept) {
        this.name = name;
        this.dept = dept;
        subList = new ArrayList<Employee>();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDept() {
        return dept;
    }

    public void setDept(String dept) {
        this.dept = dept;
    }

    public List<Employee> getSubList() {
        return subList;
    }

    public void setSubList(List<Employee> subList) {
        this.subList = subList;
    }
    //删除
    public void remove(Employee employee){
        subList.remove(employee);
    }
    //添加
    public void add(Employee employee){
        subList.add(employee);
    }
}
